from typing import Protocol

from poker_bot.core.models.dto import UserDTO
from poker_bot.core.models.dto.account import AccountDTO
from poker_bot.core.models.enums.user import UserRole
from poker_bot.domain.account import AccountEntity
from poker_bot.domain.user import UserEntity


class UserRepo(Protocol):
    async def acquire_user_by_id(self, user_id: int) -> UserEntity:
        raise NotImplementedError

    async def acquire_user_by_tg_id(self, user_tg_id: int) -> UserEntity:
        raise NotImplementedError

    async def create_user(self, user: UserEntity) -> None:
        raise NotImplementedError

    async def create_user_account(self, account: AccountEntity) -> AccountEntity:
        raise NotImplementedError

    async def update_user(self, user: UserEntity) -> None:
        raise NotImplementedError


class UserReader(Protocol):
    async def get_user_by_id(self, user_id: int) -> UserDTO:
        raise NotImplementedError

    async def get_user_by_tg_id(self, user_tg_id: int) -> UserDTO:
        raise NotImplementedError

    async def get_users(self) -> list[UserDTO]:
        raise NotImplementedError

    async def get_user_accounts(self, user_tg_id: int) -> list[AccountDTO]:
        raise NotImplementedError

    async def get_selected_user_account(self, user_tg_id: int) -> AccountDTO:
        raise NotImplementedError

    async def get_users_with_role(self, user_role: UserRole) -> list[UserDTO]:
        raise NotImplementedError

    async def get_user_by_account_account_id(self, account_id: int) -> UserDTO | None:
        raise NotImplementedError
